package cmd

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
	Use:   "pfd",
	Short: "这是简要说明",
	Long:  `这是更长的简要说明`,
	Run: func(cmd *cobra.Command, args []string) {
		// 启动每户
		fmt.Println("请添加启动参数..........")
		fmt.Println("或运行 ./pfd start")
	},
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
	err := rootCmd.Execute()
	if err != nil {
		os.Exit(1)
	}
}

func init() {
	// 全局flag
	// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.api.yaml)")

	// local flag
	rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
